package mmoon.mmoonstory;

import mmoon.mmoonstory.Potions.PotionIronSkin;
import mmoon.mmoonstory.blocks.*;
import mmoon.mmoonstory.enchantments.EnchantmentPowerfulDig;
import mmoon.mmoonstory.items.*;
import mmoon.mmoonstory.items.armors.ArmorObsidianBoots;
import mmoon.mmoonstory.items.armors.ArmorObsidianChestPlate;
import mmoon.mmoonstory.items.armors.ArmorObsidianHelmet;
import mmoon.mmoonstory.items.armors.ArmorObsidianLeggings;
import mmoon.mmoonstory.items.itemtools.*;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.potion.PotionType;
import net.minecraftforge.fml.common.registry.GameRegistry;

import java.util.ArrayList;
import java.util.Objects;

@GameRegistry.ObjectHolder(MMoonStory.MOD_ID)
public class MMoonAll {
    public static ArrayList<Item> MMOON_ITEMS = new ArrayList<>();
    public static ArrayList<Block> MMOON_BLOCKS = new ArrayList<>();
    public static ArrayList<Enchantment> MMOON_ENCHANTMENTS = new ArrayList<>();
    public static ArrayList<Potion> MMOON_POTIONS = new ArrayList<>();
    public static ArrayList<PotionType> MMOON_POTIONTYPES = new ArrayList<>();

    public static final Item HELLO_WORLD = new ItemHelloWorld();
    public static final Item CATAPULT = new ItemCatapult();
    public static final Item RAIN_SUMMON = new ItemRainSummon();
    public static final Item IRON_APPLE = new ItemIronApple();
    public static final Item UNIVERSAL_TOOL = new ItemUniversalTool();
    public static final Item INGOTS = new ItemIngots();
    public static final Item MAGIC_STICK = new ItemMagicStick();
    public static final Item OBSIDIAN_AXE = new ItemObsidianAxe();
    public static final Item OBSIDIAN_PICKAXE = new ItemObsidianPickaxe();
    public static final Item OBSIDIAN_SHOVEL = new ItemObsidianShovel();
    public static final Item OBSIDIAN_HOE = new ItemObsidianHoe();
    public static final Item OBSIDIAN_SWORD = new ItemObsidianSword();
    public static final Item OBSIDIAN_HELMET = new ArmorObsidianHelmet();
    public static final Item OBSIDIAN_CHESTPLATE = new ArmorObsidianChestPlate();
    public static final Item OBSIDIAN_LEGGINGS = new ArmorObsidianLeggings();
    public static final Item OBSIDIAN_BOOTS = new ArmorObsidianBoots();

    public static final Block GREEN_PRINT = new BlockGreenPrint();
    public static final Block EMERALD_ORE = new BlockEmeraldOre();
    public static final Block DIAMOND_CROP = new BlockDiamondCrop();
    public static final Block UNBREAKABLE_BLOCK = new BlockUnbreakable();
    public static final Block ENGINE_HOUSING = new BlockEngineHousing();
    public static final Block SCAFFOLDING = new BlockScaffolding();

    public static final Enchantment POWERFUL_DIG = new EnchantmentPowerfulDig();

    public static final Potion IRON_SKIN = new PotionIronSkin();

    public static Item Block2Item(Block block) {
        return new ItemBlock(block).setRegistryName(Objects.requireNonNull(block.getRegistryName()));
    }

    public static PotionType Potion2PotionType(Potion potion) {
        return new PotionType(potion.getName(),
                new PotionEffect(potion, 60 * 20, 0)).setRegistryName(MMoonStory.MOD_ID,
                potion.getName() + "_potion");

    }
}
